package dk.android.houseenabler.models;

import java.io.Serializable;


public class AnswerCollection implements Serializable {

	private static final long serialVersionUID = -3317183036918287472L;
	private Answer[] answersA = new Answer[33];
	private Answer[] answersB = new Answer[49];
	private Answer[] answersC = new Answer[100];
	private Answer[] answersD = new Answer[6];
	

	
	
	public Answer[] getAnswers(char letter) {
		Answer[] result = null;
		
		switch(letter) {
		case 'a':
			result = this.answersA;
			break;
		case 'b':
			result = this.answersB;
			break;
		case 'c':
			result = this.answersC;
			break;
		case 'd':
			result = this.answersD;
			break;
		}
		
		return result;
	}
	
	public Answer getAnswer(char letter, int index) {
		Answer result = null;
		
		switch(letter) {
		case 'a':
			result = this.answersA[index];
			break;
		case 'b':
			result = this.answersB[index];
			break;
		case 'c':
			result = this.answersC[index];
			break;
		case 'd':
			result = this.answersD[index];
			break;
		}
		
		return result;
	}
	
	public void addTo(char letter, int index, Answer answer) {
		if(index >= 0) {
			switch(letter) {
			case 'a':
				this.answersA[index] = answer;
				break;
			case 'b':
				this.answersB[index] = answer;
				break;
			case 'c':
				this.answersC[index] = answer;
				break;
			case 'd':
				this.answersD[index] = answer;
				break;
			}
		}
	}
	
	public void setAnswer(char letter, Answer[] answer) {
		switch(letter) {
		case 'a':
			this.answersA = answer;
			break;
		case 'b':
			this.answersB = answer;
			break;
		case 'c':
			this.answersC = answer;
			break;
		case 'd':
			this.answersD = answer;
			break;
		}
	}
}
